<template lang="pug">
  .feedfack
    table.table
      thead
        tr
          th 行业名称
          th 单位量
      tbody
        tr(v-for="(item,index) in list" :key="index")
          td {{item.industryName}}
          td {{item.industryCode}}
    .add(@click="adddivide()") 添加   
    //- .m-pagination
    //-   a(href="javascript:;" @click="gotopage(1)") 首页
    //-   a(href="javascript:;" @click="gotopage(pageNow-1)") <
    //-   a(href="javascript:;" v-for="(item,index) in this.pagecount" :key="index" @click="gotopage(item)" :class="{active:index+1==pageNow}") {{index+1}}
    //-   a(href="javascript:;" @click="gotopage(pageNow+1)") >
    //-   a(href="javascript:;"  @click="gotopage(pagecount)") 末页
</template>
<<script>
let titles = '填写时间 联系方式 单位码 单位名称 反馈内容'.split(' ')
  export default {
    name:"divide",
    data(){
      return{
        titles,
        pageNow:1,
        pageSize:10,
        list:[],
        total:0,
        pagecount:0
      }
    },
    mounted(){
      this.querylist()
    },
    methods:{
      async querylist(){
        let res = await this.$ajax.get(`xyssoManager/industry/queryAll?pageNow=${this.pageNow}&pageSize=${this.pageSize}`)
        let data = res.data
        console.log(data)
        if(data.code==200){
          this.list = data.data
          // this.total = data.size
          // this.pagecount = data.pageCount
        }
      },
      gotopage(item){
        console.log(item+"=="+this.pagecount)
        if(item > this.pagecount) return
        if(item < 1) return
        this.pageNow = item
        this.querylist()
      },
      adddivide(){
        this.$router.push('adddivide')
      }
    }

  }
</script>
<<style lang="stylus" scoped>
.feedfack
  width 1200px
  background #ffffff
  margin 0 auto
  >.table
    width 100%
    border-collapse collapse
    border-color #eeeeee
    border-width 1px 
    >thead
      >tr
        height 40px
        border-bottom 5px solid #f0f5fb
        color #999999
        font-size 12px
        >th
          font-weight normal
          &:nth-child(1)
            width 17%
          &:nth-child(2)
            width 15%
          &:nth-child(3)
            width 15%
          &:nth-child(4)
            width 16%
          &:nth-child(5)
            width 37%
            text-align left
    >tbody
      color #686868
      font-size 14px
      >tr
        border 1px solid #eeeeee
        >td
          min-height 52px
          padding 20px 0
          text-align center
          &:nth-child(5)
            text-align left
            padding-right 3%
          
  .m-pagination
    float right 
    font-size 0
    margin-top 20px
    a
      text-decoration  none 
      display inline-block
      width 32px
      height 32px
      border-radius 5px
      text-align center
      line-height 32px
      margin-right 10px
      font-size 12px
      color #999
      background #fff
      &.active
      &:hover
        background #e75a46
        color #fff
      &:first-of-type
      &:last-of-type
        width 52px
  .add
    float left
    margin-top 20px
    width 76px
    height 32px
    text-align center
    line-height 32px
    background #e75a46
    color #ffffff
    border-radius 3px
</style>

